package com.zeta.system.model.poi;

import cn.hutool.core.date.DatePattern;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.DateTimeFormat;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import cn.idev.excel.annotation.write.style.ContentRowHeight;
import cn.idev.excel.annotation.write.style.HeadRowHeight;
import com.zeta.system.poi.convert.SexConverter;
import com.zeta.system.poi.convert.UserStateConverter;
import lombok.Data;
import org.zetaframework.base.excel.convert.LocalDateConverter;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 用户Excel导出数据
 *
 * @author gcc
 */
@Data
@HeadRowHeight(27)
@ContentRowHeight(21)
public class SysUserExportVO {
    /** id */
    @ColumnWidth(25)
    @ExcelProperty(value =  "id")
    private Long id;

    /** 用户名 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "用户名")
    private String username;

    /** 账号 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "账号")
    private String account;

    /** 密码 */
    @ColumnWidth(60)
    @ExcelProperty(value =  "密码")
    private String password;

    /** 邮箱 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "邮箱")
    private String email;

    /** 手机号 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "手机号")
    private String mobile;

    /** 性别 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "性别", converter = SexConverter.class)
    private Integer sex;

    /** 生日 */
    @ColumnWidth(20)
    @ExcelProperty(value =  "生日", converter = LocalDateConverter.class)
    private LocalDate birthday;

    /** 状态 */
    @ColumnWidth(15)
    @ExcelProperty(value =  "状态", converter = UserStateConverter.class)
    private Integer state;

    /** 用户角色 */
    @ColumnWidth(20)
    @ExcelProperty(value =  "用户角色")
    private String roles;

    /** 注册时间 */
    @ColumnWidth(20)
    @ExcelProperty(value =  "注册时间")
    @DateTimeFormat(DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;
}
